<?php
  function search_engine_optimization_option()
  {
    ?>
       <div class="wrap">
            <?php screen_icon(); ?>
	        <h2>Tối ưu hóa công cụ tìm kiếm - SEO</h2>
            
            <!-- Cập nhật SEO -->
            <?php
            if ( !empty($_POST) && wp_verify_nonce($_POST['seo_index'],'seo_index_update') )
              {
                  	update_option( 'home_title',($_POST['home_title']));
                  	update_option( 'home_robots',($_POST['home_robots']));
                    update_option( 'google_analytics',($_POST['google_analytics'])  );
              		update_option( 'home_description',($_POST['home_description']) );
              		update_option( 'home_keywords',($_POST['home_keywords'])  );

              		?>
              		<div id="index_message" name="index_message" class="updated">Cập nhật thành công!</div><br/>
              		<?php
              }
            ?>         
           <!-- Cập nhật tùy chỉnh trang SEO -->
           <div id="index_page" style="border-style:outset;border-width: 1px;padding: 0px 20px 10px 20px;margin-top: 10px;">
              <h3>Tối ưu SEO trang chủ</h3>
               <form action="" method="post" id="seo_index_page" >
                  <label for="home_title"><strong>Title</strong><em>(Tối đa 60 ký tự)</em></label>
                  <br/>
                  <input type="text" name="home_title" size="40" style="border-style:inset;border-width: 2px;color: #6666FF;background-color: #CCCCFF" value="<?php echo esc_attr( get_option('home_title') ); ?>"/>&nbsp;  &nbsp;  &nbsp;
                 <label for="google_analytics"><strong>Robots:</strong></label>
                  <input type="text" name="home_robots" size="10" style="border-style:inset;border-width: 2px;color: #6666FF;background-color: #CCCCFF" value="<?php echo esc_attr( get_option('home_robots') ); ?>"/>
                <label for="google_analytics"><strong>Mã Google Analytics:</strong></label>
                  <input type="text" name="google_analytics" size="15" style="border-style:inset;border-width: 2px;color: #6666FF;background-color: #CCCCFF" value="<?php echo esc_attr( get_option('google_analytics') ); ?>"/>
               
                  <br/>
                  <label for="home_description"><b>Description</b><em>(Tối đa 160 ký tự)</em></label><br/>
          		<textarea name="home_description"  rows="1" cols="100" style="with:100%;border-style:inset;border-width: 2px;color: #6666FF;background-color: #CCCCFF"><?php echo esc_attr( get_option('home_description') ); ?></textarea><br/>
                  <label for="home_keywords"><b>Keywords</b><em>(Tối đa 250 ký tự)</em></label><br/>
          		<textarea name="home_keywords"  rows="2" cols="100" style="with:100%;border-style:inset;border-width: 2px;color: #6666FF;background-color: #CCCCFF" ><?php echo esc_attr( get_option('home_keywords') ); ?></textarea><br/>
				
                <input type="submit" name="seo_submit" value="Cập nhật" style="border-style:outset;border-width: 2px;font-weight: bold" /></p>
                <?php wp_nonce_field('seo_index_update','seo_index'); ?>
               </form>
           </div>
       </div>
    <?php
  }
  